Odo is a WDEF that changes its form based on its title. Odo looks for a PICT resource that has the same name as its title to mold itself to. This is only of interest to programmers and curiosity seekers.
Why the hell did you waste your time doing that?
I thought it'd be cool for startup screens - since they're rarely seen - to be a little more creative. The only product that currently uses the OdoWDEF is OdoClock.
What else?
Odo has the following variants (and combinations thereof):
Variant 1: Use BitMapToRegion() to create the window's structure (as opposed to OpenRgn(), DrawPicture(), CloseRgn().
Variant 2: All white areas are transparent. (Otherwise, all drawn areas are part of the structure region).
Variant 4: The content region is practically empty, the Picture is automatically drawn.
Variant 8: All hits register as "inDrag" (in the next version - unless variant 4 is ON, then XOR the bounds of the Picture with Odo region to get the content region instead. Offset the regions appropriately. This will let you create your own window styles.)
See the demo file with ResEdit or Resorcerer to get the feel for what effect Variant 1 has on your window. I've put a few demos (DLOGs and WINDs) in there, most of which (oddly) look better with Variant 1 ON.
What should I watch out for?
I have had one crash due to Odo. I had Remember? (a desk accessory) in the background. When a window closing caused the System to do some region calculations, the complex regions caused Remember?'s heap to be insufficient and bombed with System Error #19. I had very complex Odos visible at the time - presumedly this should not happen with normal usage - but be forwarned about very complex Odos containging lots of jaggies.
Using Variant 4 uses less memory, since the contRgn is practically empty. (Actually the contRgn contains two points, the topLeft most and bottomRight most points of the port). You should be aware that Variant 4 Odos can not be normally drawn into, since the content region is empty.
If the title of the window ends in '®', the Picture and Region will be re-recorded and saved using the window's structure region to the resID + 1 of the original PICT. This is only for utility and experimentation reasons. The code is called when the drawing is done for the first time:
-
OpenPicture()
DrawPicture()
ClosePicture()
-
AddResource()
WriteResource()
UpdateResFile()
-
The best example for the use of this is the "Roche Recorder" 'WIND' resource which changes white text to transparent text when recorded. (Resorcerer will not show the new PICT until the file is closed and reopened.)
Can I use it?
Sure. Why do you think I released it? If you want a PPC one, let me know. Since I assume Odos only use is for titles, I can't really see the true use of a double size PPC version.
What's the catch?
22. Just kidding.
A credit is due somewhere visible containing the following string:
For questions, comments, or to let me know you are using Odo in your product, contact:
Gregory Lemperle-Kerr
AKUA interactive media AG, ASTARTE GmbH & AKUA interactive media, inc.
Internet: ASTARTE@AppleLink.apple.com or 100441.1272@CompuServe.com
Why the silly title?
I'm not even sure I spelled it correctly, but Odo is supposed to be named after the shape-changing character in "Star-Trek DS-9". (I'm not even sure he's called a shape-changer in English, since I've only seen DS-9 in German.)